package com.ddxcloud.movie.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ddxcloud.movie.data.dto.PageDTO;
import com.ddxcloud.movie.data.entity.Order;
import com.ddxcloud.movie.data.vo.OrderVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface OrderMapper extends BaseMapper<Order> {

    IPage<OrderVO> getOrderList(Page<OrderVO> page, @Param("dto") PageDTO dto);

    OrderVO getOrderInfo(Long orderId);

    Order getOrderByOrderSn(String orderSn);

    Integer isExistSpecialOrderByChannelId(Long userId, String channelId);

    Integer getOrderNumByFilmId(String filmId, String channelId);

    Integer isExistOrderByCouponCode(String couponCode, String channelId);
}
